#define _CRT_SECURE_NO_WARNINGS 1

#include <stdio.h>

int main()
{
    int n;
    scanf("%d", &n);

    int x = 1;
    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < n; j++)
        {
            printf("%02d", x);
            x++;
        }
        printf("\n");
    }

    printf("\n");
    int y = 1;
    for (int i = 1; i <= n; i++)
    {
        for (int j = 0; j < n - i; j++)
            printf("  ");
        for (int t = 0; t < i; t++)
        {
            printf("%02d", y);
            y++;
        }
        printf("\n");
    }
    return 0;
}